package com.wanxi.recursion;

public class RecursionFactorial {
    public static void main(String[] args) {
        int i = 4;
        int result = 0;
        result = factorial(i);
        System.out.println(result);
    }

    public static int factorial(int i) {
        if (i > 0) {
            return i *= factorial(i - 1);
        }
        return 1;
    }
}
